<html>
    <head>
        <meta name="title" content="Merashehar - Any information in your city!" />

        <meta name="DESCRIPTION" content="Merashehar - Any information in your city, provides comprehensive updated information on all B2B and B2C Products and Services. Services available in all major and secondary Indian cities including Hyderabad, Bhimavaram, Tanuku, Tadepalligudem  and many more.">

        <meta name="keywords" content="Merashehar, Mera Shehar, Mera Shahar, local search, local businesses, yellow pages, online yellow pages, yellow pages india, India trade directory,  yellow pages directory, city yellow pages, indian search engine, information, reliable Infomation, where in city, what in city, " />
        <script type="text/javascript" src="../js/global.js"></script>
        <script type="text/javascript" src="../js/jquery-1.6.2.min.js"></script>
    </head>
    <%@page import="com.merashehar.contants.MerasheharContants"%>
    <%@page import="java.sql.SQLException"%>
    <%@page import="java.sql.ResultSet"%>
    <%@page import="com.merashehar.db.util.DatabaseHandler"%>
    <%@page import="com.merashehar.db.util.ConnectionManager"%>
    <%

        StringBuilder citySB = new StringBuilder();
        ConnectionManager connectionManager = new ConnectionManager();
        DatabaseHandler databaseHandler = new DatabaseHandler();

        ResultSet resultSet = databaseHandler.getResultSet(MerasheharContants.findAllCities, connectionManager.getConnection());

        // categorySB.append("<div class=\"cateogorieBarHeader\"> Browse by Categories</div>");
        citySB.append("<select onchange='document.itemForm.city.value=this.options[this.selectedIndex].id;'><option id=\"-1\">Select City</option>");
        try {
            while (resultSet.next()) {
                citySB.append("<option id='" + resultSet.getString(1) + "' >" + resultSet.getString("city_name") + "</option>");
            }
        } catch (SQLException sqe) {
            sqe.printStackTrace();
        }
        citySB.append("</select>");

        resultSet = databaseHandler.getResultSet(MerasheharContants.findAllCategories, connectionManager.getConnection());
        StringBuilder categorySB = new StringBuilder();
        // categorySB.append("<div class=\"cateogorieBarHeader\"> Browse by Categories</div>");
        categorySB.append("<select  onchange=\"showSubCategoriesAdmin(this);onchange='document.itemForm.category.value=this.options[this.selectedIndex].id;'\"><option id=\"-1\">Select Category</option>");
        try {
            while (resultSet.next()) {
                categorySB.append("<option id='" + resultSet.getString(1) + "'  >" + resultSet.getString(2) + "</option>");
            }
        } catch (SQLException sqe) {
            sqe.printStackTrace();
        }
        categorySB.append("</select>");




    %>
    <body>
        <form name="itemForm" method="POST" action="/1.0.0/ItemCRUDServlet">
            <table>
                <tr>
                    <td>City</td><td><%=citySB%><input type="hidden" name="city"/></td>
                </tr>
                <tr>
                    <td>Category</td><td><%=categorySB%><input type="hidden" name="category"/></td>
                </tr>
                <tr>
                    <td>Sub Category</td><td><div id="subCategoriesAdmin">Select a category and then subcategory will be loaded here.</div><input type="hidden" name="subcategory"/></td>
                </tr>
                <tr>
                    <td>Item Name</td><td><input type="text" name="itemname"/></td>
                </tr>
                <tr>
                    <td>Item Image URL</td><td><input type="text" name="itemurl"/></td>
                </tr>
                <tr>
                    <td>Item Description</td><td><textarea name="itemdesc"></textarea></td>
                </tr>
                <tr>
                    <td>Address Line1</td><td><textarea name="addressline1"></textarea></td>
                </tr>
                <tr>
                    <td>Address Line2</td><td><textarea name="addressline2"></textarea></td>
                </tr>
                <tr>
                    <td>Phone 1</td><td><input type="text" name="phone1"/></td>
                </tr>
                <tr>
                    <td>Phone 2</td><td><input type="text" name="phone2"/></td>
                </tr>
                <tr>
                    <td>Mobile</td><td><input type="text" name="mobile"/></td>
                </tr>
                <tr>
                    <td>Zip</td><td><input type="text" name="zip"/></td>
                </tr>
                <tr>
                    <td>Landmark 1</td><td><input type="text" name="landmark1"/></td>
                </tr>
                <tr>
                    <td>Landmark 2</td><td><input type="text" name="landmark2"/></td>
                </tr>
                <tr>
                    <td></td>
                    <td><input type="submit"/></td>
                </tr>
            </table>
        </form>
    </body>
    <%%>
</html>
